if (!jsx3.lang.Class.forName("ux.cdb.admin.customer.history.historyDialog")) {

/**
 * Define the <code>name of class</code> class.
 * This class inherit from <code>jsx3.gui.Block<code> GUI class.
 */
	jsx3.Class.defineClass(
		"ux.cdb.admin.customer.history.historyDialog",
		jsx3.gui.Dialog,
		null,
		function (objRoot) {
			/**
			 * This method will be called after UI file has deserialized.
			 */
			objRoot.prototype.onAfterDeserialize = function() {
				/*
				ux.megatron.util.Dwr.callDwr("AddStudentInfoUCC", "getEmploymentHistoryInfo", 
					[this.dataBag['baseInfo']], this, function(obj) {
					console.log("get history",obj);
					this.showHistory(obj);
				});
				*/
			}
			
			objRoot.prototype.onClose = function() {
				this.doClose();
			};
			
			objRoot.prototype.showHistory = function (objEvent) {
				var me = this;
				if(this.hisType == 'study') {
					ux.megatron.util.Dwr.callDwr("AddStudentInfoUCC", "getSchoolingStatusHistoryInfo", 
						[this.studentId], this, function(obj) {
							console.log("get study his",obj);
							var mtx = this.getDescendantOfName("mtxStudy");
							me.populateMtx(mtx, obj.content.data);
					});
				}
				else if(this.hisType == 'career') {
					ux.megatron.util.Dwr.callDwr("AddStudentInfoUCC", "getEmploymentHistoryInfo", 
						[this.studentId], this, function(obj) {
							console.log("get career his",obj);
							var mtx = this.getDescendantOfName("mtxCareer");
							me.populateMtx(mtx, obj.content.data);
					});
				}
			};
			
			objRoot.prototype.populateMtx = function(mtx, objs) {
				var cdf = ux.megatron.util.Dwr.toCdfDocument(objs);
				for(i=0; i<cdf.getChildNodes().size(); i ++) {
					var record = cdf.getChildNodes().get(i);
					record.setAttribute("jsxid", i+1);
				}
				console.log(cdf);
				if(this.hisType == 'study') {
					ux.megatron.Main.getServer().getCache().setDocument("ConsumerHisStudyMatrix_0302", cdf);
				} 
				else if(this.hisType == 'career') {
					ux.megatron.Main.getServer().getCache().setDocument("ConsumerHisCareerMatrix_0302", cdf);
				}
				//mtx.setSourceXML(cdf);
				mtx.repaintData();
			}
			
			objRoot.prototype.loadUI = function() {
				this.blkMatrix = this.getDescendantOfName("blkMatrix");
				this.windowBar = this.getDescendantOfName("windowBar");
				this.label = this.getDescendantOfName("label");
				var me = this;
				if(this.hisType == 'study') {
					this.windowBar.setText(ux.megatron.Main.getServer().getDynamicProperty("@cdb@customer@his@schoolStatusTitle"), true);
					this.label.setText(ux.megatron.Main.getServer().getDynamicProperty("@cdb@customer@his@schoolStatusTitle"), true);
					ux.megatron.Main.loadUIResourceAsync(this.blkMatrix,"ux.cdb.admin","ux/cdb/admin/customer/history/ui/studyHis.xml", me, me.showHistory);
				}
				else if(this.hisType == 'career') {
					this.windowBar.setText(ux.megatron.Main.getServer().getDynamicProperty("@cdb@customer@his@careerStatusTitle"), true);
					this.label.setText(ux.megatron.Main.getServer().getDynamicProperty("@cdb@customer@his@careerStatusTitle"), true);
					ux.megatron.Main.loadUIResourceAsync(this.blkMatrix,"ux.cdb.admin","ux/cdb/admin/customer/history/ui/careerHis.xml", me, me.showHistory);
				}
			};
			
		});
}